# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=kacak
pkgver=1.0
pkgrel=7
groups=('blackarch' 'blackarch-recon')
pkgdesc='Tools for penetration testers that can enumerate which users logged on windows system.'
arch=('any')
depends=('python2' 'python2-lxml' 'python2-python-nmap' 'metasploit')
url='https://github.com/galkan/kacak'
license=('custom:unknown')
source=("https://github.com/galkan/$pkgname/archive/v$pkgver.tar.gz")
sha512sums=('74221f83974c8447aeb28aeab5dfbcff7a45b5bf')

package() {
  cd "$pkgnmae-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm README.md LICENSE.txt

  cp -a --no-preserve=ownership * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

